package com.sky.mapper;

import com.sky.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.time.LocalDateTime;

/**
 * 目标:
 *
 * @author YUE
 * @date 2024/6/15 16:15
 */
@Mapper
public interface UserMapper {

    @Select("select * from user where openid = #{openid}")
    User getByOpenid(String openid);


    void insert(User user);

    @Select("select * from user where id = #{id}")
    User getById(Long id);

    @Select("select count(*) from user where create_time between #{beginTime} and #{endTime}  ")
    Integer getUser(LocalDateTime beginTime, LocalDateTime endTime);
}
